#include <zlib.h>
#include <string>
#include <iostream>

float kolmogorov(std::string const& s) {
	
	unsigned int sourceSize = s.size();	
	const char * source = s.c_str();
	
	unsigned long dsize = compressBound(sourceSize);//sourceSize + (sourceSize * 0.1f) + 16;
	char * destination = new char[dsize];
	
	int result = compress2((unsigned char *)destination, &dsize, (const unsigned char *)source, sourceSize, 9);
	
	if(result != Z_OK)
		std::cerr << "Compress error occured! Error code: " << result << std::endl; 
	
	return (float)dsize/(float)sourceSize;
}

bool kolmo_rule(std::string key){
    unsigned int k=kolmogorov(key)*100000;
    if(k==130769 || k==123076) return true;
    return false;
}